<template>
  <div class="box">
    <img :src="url" alt />
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      url: ""
    };
  },
  created() {
    this.getParams();
  },
  methods: {
    getParams() {
      // 取到路由带过来的参数
      this.url = this.$route.query.url;
      console.log("接受的url的值：", routerParams);
    }
  }
};
</script>
<style scoped>
.box {
  background-color: rgba(0, 0, 0, 0.5);
  height: 100%;
  position: absolute;
  width: 100%;
  text-align: center;
}
img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
}
</style>


